<%@page import="java.io.* , java.util.*, java.sql.*,  com.myapp.struts.dao.*, com.myapp.struts.beans.*"%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <title>AccountHead View</title>
        <link href="../../../../css/cms.css" rel="stylesheet" type="text/css">
		<script language="javascript">
        function Validate()
			{
			var index1=document.scheduleLevel1.schedulename.selectedIndex;                        
                        if(index1<=0)
                        {
                            alert("Please Select Schedle Name....");                            
                            document.scheduleLevel1.schedulename.focus();
                            return false;
                        }
						
						if (document.getElementById("sub1").value=="")
						{
							alert("ENTER SUB SCHEDULE 1....");
							document.getElementById("sub1").focus();
							return false;
						}
						if (document.getElementById("sub2").value=="")
						{
							alert("ENTER SUB SCHEDULE 2....");
							document.getElementById("sub2").focus();
							return false;
						}
						
						if (document.getElementById("desc").value=="")
						{
							alert("ENTER DESCRIPTION....");
							document.getElementById("desc").focus();
							return false;
						}
						return ture;
             }
		</script>
    </head>

    <body bgcolor="#D3F1D5">
        <%
            String scheduleno=request.getParameter("scheduleno");
            String schedulename=request.getParameter("schedulename");
            String schlevel=request.getParameter("schlevel");

                int sclevel=Integer.parseInt(schlevel);
	  	
                if (sclevel==1)
                {
        %>
        <form id='scheduleLevel1' name='scheduleLevel1' method='post' action="ScheduleInsert" onSubmit="return Validate();">
            <table border='0' align='center' cellpadding="0" cellspacing="0" style="border-right: #000000 1px solid;
                   border-top: #000000 1px solid; border-left: #000000 1px solid;  border-bottom: #000000 1px solid; font-size: 9pt; color: #000000; font-family: Arial;">
                <tr>
                    <th height='29' colspan='2' align='center'>Creation of Schedule and Main Schedule</th>
              </tr>
                <tr >
                    <td width="253" class="tabledata">Schedule Number</td>
                    <td width="369"><input name="scheduleno" readonly value="<%=scheduleno%>" type="text" size="\" maxLength=20 /></td>
                </tr>
                <tr>
                    <td class="tabledata">Schedule Name</td>
                    <td><select name="schedulename">
                    <option></option>
                            <option><%=schedulename%></option>
                        </select></td>
                </tr>
                <tr>
                    <td class="tabledata">Sub Schedule 1</td>
                    <td><input name='sub1' type='text' id='sub1' /></td>
                </tr>
                <tr>
                    <td class="tabledata">Sub Schedule 2</td>
                    <td><input name='sub2' type='text' id='sub2' /></td>
                </tr>
                <tr>
                    <td class="tabledata">Description</td>
                    <td><label>
                            <input name='desc' type='text' id='desc' />
                        </label></td>
                </tr>
                <tr>
                    <td colspan='2' align='center'><input name='Submit1' type='submit' class="tabledata"  value='Submit'/></td>
                </tr>
            </table>
    </form>
        <%}
                if (sclevel==2)
                {
   	
                        RequestDispatcher rd=request.getRequestDispatcher("../../../../SchedulesListServlet?sname="+schedulename+"&schno="+scheduleno);
                rd.forward(request,response);
            }
                if (sclevel==3)
                {
        %>
        
        <%}%>
    </body>
</html>
